# configuration
dna_length = 1009
probes_length = 10
errors_rate = 0.5	# przedzial (0;1)
vocabulary = ['c', 'g', 't', 'a']

import random
import sys

#
def generate_polypeptydes(dna, probes_length):
	out = []
	for i in range(len(dna)-probes_length+1):
		out.append(dna[i:i+probes_length])
	return out

#
def generate_dna(length, vocabulary):
	dna = ""
	for i in range(length):
		dna = dna + random.choice(vocabulary)
	return dna

###########################################################
# main code
###########################################################

dna_length = (int)(sys.argv[1])
errors_rate = (float)(sys.argv[2])

# print dna_length, errors_rate

dna = generate_dna(dna_length, vocabulary)
polypeptides = generate_polypeptydes(dna, probes_length)

random.shuffle(polypeptides)
polypeptides = polypeptides[0:(int)((dna_length-9)*(1.0-errors_rate))]


# print length od dna sequence, length & number of polypeptydes
# print dna_length, "\n", probes_length, "\n", len(polypeptides)
for poly in polypeptides:
	print poly

# print "\n", dna 
